<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="../js/vue.js"></script>
    <title>Document</title>
</head>
<body>
    <div id="app">
        <div @click="show('父')">
            父盒子
            <div @click.stop="show('子')">
                子盒子
            </div>
        </div>

        <div @click.once="show">
            <button>A</button>
            <button>B</button>
            <button>C</button>
        </div>

        <h1>阻止默认行为</h1>
        <a @click.prevent="handle" href="http://baidu.com">百度</a>
    </div>
</body>
<script>
var vm = new Vue({
    el: "#app",
    methods:{
        show(){
           console.log( event.target);
        },
        handle(){
            console.log('hello');
        }
    }
});
</script>
</html>